﻿using log4net;
using System;
using System.Data;
using System.Reflection;
using System.Threading;

public class RegnoGifManager
{
    private ILog log = null;
    private RegnoGifDao RegnoGifDao;

    public RegnoGifManager()
    {
        this.log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
        this.RegnoGifDao = new RegnoGifDao();
    }

    public int getMaxISSUE()
    {
        return this.RegnoGifDao.getMaxISSUE();
    }

    public DataSet getNoFinishedOne()
    {
        while (true)
        {
            try
            {
                this.log.Info("开始读取数据库表REGNO_GIF中尚未dll分析的公告...");
                return this.RegnoGifDao.getNoFinishedOne();
            }
            catch (Exception exception)
            {
                this.log.Error("读取数据库表REGNO_GIF中尚未dll分析的公告异常.", exception);
                Thread.Sleep(0x1388);
            }
        }
    }

    public void insertNewISSUE(int issue, DateTime issueDate, string[] pageStaEnd)
    {
        this.RegnoGifDao.insertNewISSUE(issue, issueDate, pageStaEnd);
    }

    public void updateFinish(int id)
    {
        this.RegnoGifDao.updateFinish(id);
    }

    public void updatePageNo(int id, int pageNo)
    {
        this.RegnoGifDao.updatePageNo(id, pageNo);
    }
}

